package zuoye11;

public class make extends Thread {
    public void run() {
        synchronized (desk.lock) {
            while (desk.counter!=0) {
                if (desk.flag == false) {
                    desk.counter--;
                    System.out.println("生产中");
                    desk.flag = true;
                    desk.lock.notify();
                } else {

                    try {
                        desk.lock.wait();
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }

            } }
    }

}
